package zhongbo.java.air.dictionary.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;

import javax.validation.constraints.*;
import java.util.Date;
import java.io.Serializable;

/**
 * 机场信息表(AirAirport)实体类
 *
 * @author 朱星谊
 * @since 2025-03-31 14:05:51
 */
@Data
@TableName("air_airport")
@ApiModel("机场信息")
public class AirAirport implements Serializable {

    @ApiModelProperty("UUID 主键")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @NotBlank(message = "ICAO机场代码不能为空")
    @Size(min = 4, max = 4, message = "ICAO机场代码长度需为4位")
    @ApiModelProperty(value = "ICAO机场代码", example = "011")
    private String icaoCode;

    @NotBlank(message = "IATA代码不能为空")
    @Size(min = 3, max = 3, message = "IATA机场代码长度需为3位")
    @ApiModelProperty(value = "IATA代码", example = "011")
    private String iataCode;

    @NotBlank(message = "机场全称不能为空")
    @Size(min = 2, max =100, message = "机场全称长度需在2到50位之间")
    @ApiModelProperty(value = "机场全称", example = "天府机场")
    private String name;

    @NotNull(message = "纬度不能为空")
    @PositiveOrZero(message = "纬度不能为负数")
    @ApiModelProperty(value = "纬度", example = "0.00")
    private Double latitude;

    @NotNull(message = "经度不能为空")
    @PositiveOrZero(message = "经度不能为负数")
    @ApiModelProperty(value = "经度", example = "0.00")
    private Double longitude;

    @NotBlank(message = "状态不能为空")
    @Pattern(regexp = "^(OPERATIONAL|CLOSED|RESTRICTED)$", message = "状态只能为OPERATIONAL,CLOSED,RESTRICTED")
    @ApiModelProperty(value = "状态", example = "OPERATIONAL")
    private String status;

    @NotBlank(message = "时区不能为空")
    @Size(min = 1, max = 50, message = "时区长度需在1到50位之间")
    @ApiModelProperty(value = "时区", example = "ShangHai")
    private String timezone;

    @PastOrPresent(message = "创建时间不能为未来时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间",example = "2025-3-31 16:33:33")
    private Date createTime;

    @PastOrPresent(message = "更新时间不能为未来时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间",example = "2025-3-31 16:33:33")
    private Date updateTime;


}

